package com.example.yuanann.vegetable_app.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.yuanann.vegetable_app.R;
import com.example.yuanann.vegetable_app.activity.Mygoods;
import com.example.yuanann.vegetable_app.activity.Mygoods0;
import com.example.yuanann.vegetable_app.activity.Mygoods1;
import com.example.yuanann.vegetable_app.activity.Mygoods2;

public class Pub_list extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_home_pub_list,container,false);
        return view;
    }
    public void onActivityCreated(Bundle savedInstanceState) {

        super.onActivityCreated(savedInstanceState);
        super.onCreate(savedInstanceState);
        ImageView m1,m2,m3,m4;
        m1 = (ImageView) getActivity().findViewById(R.id.m1);
        m2 = (ImageView) getActivity().findViewById(R.id.m2);

        m1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(getActivity(), Mygoods0.class);
                intent.putExtra("num", 3);
                startActivity(intent);
            }
        });
        m2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent();
                intent.setClass(getActivity(), Mygoods.class);
                intent.putExtra("num", 3);
                startActivity(intent);
            }
        });
    }
}